package com.fzrskj.cloud.free.user.utils.agent;

import com.fzrskj.cloud.free.sys.bean.SysArticleView;
import com.fzrskj.cloud.free.sys.utils.SysArticleUtils;
import org.apache.commons.collections.map.HashedMap;

import java.util.List;
import java.util.Map;

/**
 * InitDataOfArticleHelper.
 *
 * @author zj.
 *         Created on 2019/8/29 0029.
 */
public class InitDataOfArticleHelper {
    public static void copyArticle(Integer agentId, String agentName) {
        SysArticleUtils articleUtils = new SysArticleUtils();
        Map<String, Object> cdt = new HashedMap();
        cdt.put("sa.agentId", agentId);
        List<SysArticleView> articleList = articleUtils.querySysArticleList(cdt, 1, 1);
        if (null == articleList || articleList.isEmpty()) {
            articleUtils.initAgent(agentId, agentName);
        }
    }
}
